/* 全局样式 */
:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --secondary-color: #e74c3c;
  --accent-color: #f39c12;
  --light-accent: #f1c40f;
  --success-color: #2ecc71;
  --info-color: #3498db;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --light-bg: #f8f9fa;
  --dark-bg: #343a40;
  --text-color: #2c3e50;
  --light-text: #ecf0f1;
  --gray-text: #95a5a6;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: 'Nunito', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-color);
  background-color: #f5f7fa;
  line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

.nav-link {
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.nav-link:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--light-accent);
  transition: var(--transition);
  transform: translateX(-50%);
}

.nav-link:hover:after {
  width: 70%;
}

/* 卡片样式 */
.card {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
  font-weight: 600;
  border-bottom: none;
}

.card-header.bg-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
}

.card-header.bg-success {
  background: linear-gradient(135deg, var(--success-color), #27ae60) !important;
}

.card-header.bg-danger {
  background: linear-gradient(135deg, var(--danger-color), #c0392b) !important;
}

/* 按钮样式 */
.btn {
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border: none;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #27ae60);
  border: none;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color), #d35400);
  border: none;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #c0392b);
  border: none;
}

/* 评分星星样式 */
.rating {
  display: inline-flex;
  align-items: center;
}

.rating .fa-star, .rating .fa-star-half-alt {
  color: var(--light-accent);
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
  margin-right: 2px;
}

/* 书籍列表样式 */
.book-list-item {
  transition: var(--transition);
  border-radius: var(--border-radius);
  padding: 1rem;
}

.book-list-item:hover {
  background-color: rgba(52, 152, 219, 0.05);
  transform: translateX(5px);
}

/* 书籍详情页样式 */
.book-cover {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

.book-info {
  padding: 1.5rem;
  position: relative;
}

.book-title {
  font-weight: 700;
  color: var(--primary-dark);
}

.book-author {
  color: var(--gray-text);
  font-style: italic;
}

/* 评论样式 */
.review-item {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  background-color: white;
  box-shadow: var(--box-shadow);
}

.review-user {
  font-weight: 600;
  color: var(--primary-dark);
}

.review-date {
  font-size: 0.8rem;
  color: var(--gray-text);
}

/* 收藏书籍卡片 */
.favorite-card {
  height: 100%;
}

.favorite-card .card-body {
  display: flex;
  flex-direction: column;
}

.favorite-card .card-text {
  flex-grow: 1;
}

/* 排行榜样式 */
.ranking-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--dark-bg);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 10px;
}

.top-three .ranking-number {
  background: linear-gradient(135deg, var(--light-accent), var(--accent-color));
  color: var(--dark-bg);
}

/* 页脚样式 */
footer {
  background-color: var(--dark-bg);
  color: var(--light-text);
  padding: 2rem 0;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .card {
    margin-bottom: 1.5rem;
  }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background-color: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-dark);
}

/* 推荐系统相关样式 */
.recommendation-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

.book-card {
  position: relative;
  transition: all 0.3s ease;
}

.book-card.hover-effect {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.recommendation-tags {
  min-height: 28px;
}

.recommendation-features {
  list-style: none;
  padding-left: 0;
}

.recommendation-features li {
  padding: 10px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.recommendation-features li:last-child {
  border-bottom: none;
}

.recommendation-explanation {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 240, 0.9));
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

/* 首页个性化推荐部分 */
.personalized-section {
  background-color: rgba(52, 152, 219, 0.05);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-top: 3rem;
  position: relative;
}

.personalized-section:before {
  content: "个性化";
  position: absolute;
  top: -15px;
  left: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
}

.recommendations-carousel {
  overflow: hidden;
  padding: 1rem 0;
}

.recommendations-carousel .row {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 15px;
}

.recommendations-carousel .row::-webkit-scrollbar {
  display: none;
}

.recommendations-carousel .col-md-4 {
  flex: 0 0 auto;
  width: 280px;
  margin-right: 15px;
}

/* 相似书籍部分 */
.similar-books-section {
  background-color: rgba(46, 204, 113, 0.05);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: 2rem;
}

.similar-books-title {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.similar-books-title i {
  color: var(--success-color);
  margin-right: 10px;
}

.similar-book-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.similar-book-card:hover {
  border-color: var(--success-color);
} 